﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

using AMPLibrary;
using AMPLibrary.Media;
using AMPLibrary.Collections;

namespace MediaLibrary.Controls
{
    /// <summary>
    /// Interaction logic for NewAutomaticPlaylistWindow.xaml
    /// </summary>
    public partial class NewAutomaticPlaylistWindow : Window
    {
        public string PlaylistPath
        {
            get;
            set;
        }

        public NewAutomaticPlaylistWindow()
        {
            InitializeComponent();
        }
        
        private void cancelButton_Click(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
            this.Close();
        }

        private void createPlaylistButton_Click(object sender, RoutedEventArgs e)
        {
            if (playlistNameTextBox.Text == string.Empty)
                return;

            AutomaticPlaylistCollection apc = AutomaticPlaylistCollection.GetAutomaticPlaylistCollection();
            apc.AddItem(new AutomaticPlaylist() { PlaylistName = playlistNameTextBox.Text });

            DialogResult = true;
            this.Close();
        }
    }
}
